import { createStore,combineReducers,applyMiddleware} from 'redux'
import thunkMiddleware from 'redux-thunk'  //异步的包
let state1 = {
    list:[
        {
            id:1,
            title:'一周日语伤心',
            img:require('../assets/1.png')
        },
        {
            id:1,
            title:'今天从没有理由',
            img:require('../assets/2.png')
        },
        {
            id:1,
            title:'那些好听的欧美歌曲',
            img:require('../assets/3.png')
        },
        {
            id:1,
            title:'一个天蝎座的歌单',
            img:require('../assets/4.png')
        },
        {
            id:1,
            title:'爱上电音只需一单',
            img:require('../assets/5.png')
        },
    ],
    chinamusic:[
        {
            id:1,
            name:'年少有为',
            img:require('../assets/5.png')
        },
        {
            id:2,
            name:'过客',
            img:require('../assets/4.png')
        },
        {
            id:3,
            name:'游山恋',
            img:require('../assets/3.png')
        },
    ],
    chinamusic2:[
        {
            id:1,
            name:'不舍',
            img:require('../assets/1.jpg')
        },
        {
            id:2,
            name:'美丽的神话',
            img:require('../assets/2.png')
        },
        {
            id:3,
            name:'笑看',
            img:require('../assets/1.png')
        },
    ]   
}

function readData(state=state1,action){
    return state
}
// const store = createStore(readData,state)
const store = createStore(combineReducers({
    list:readData
}),applyMiddleware(thunkMiddleware))
export default store